package chabernac.android.draw;

import java.util.concurrent.ThreadFactory;

public class PriorityThreadFactoryDecorator implements ThreadFactory {
	private final ThreadFactory myDelegate;
	private int myPriority;
	
	public PriorityThreadFactoryDecorator(ThreadFactory myDelegate) {
		super();
		this.myDelegate = myDelegate;
	}


	@Override
	public Thread newThread(Runnable r) {
		Thread theThread = myDelegate.newThread(r);
		theThread.setPriority(myPriority);
		return theThread;
	}


	public int getPriority() {
		return myPriority;
	}

	public void setPriority(int aPriority) {
		myPriority = aPriority;
	}
}
